import { BasicColumn, FormSchema } from '/@/components/Table';

export const Permission = {
  ADD: 'dict.detail.add',
  EDIT: 'dict.detail.edit',
  DEL: 'dict.detail.del',
};

export const columns: BasicColumn[] = [
  {
    title: '标签',
    dataIndex: 'label',
  },
  {
    title: '值',
    dataIndex: 'value',
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'label',
    label: '标签',
    component: 'Input',
    rules: [
      { required: true, message: '请填写标签' },
      { max: 100, message: '标签最多100字' },
    ],
  },
  {
    field: 'value',
    label: '值',
    component: 'InputNumber',
    rules: [
      { required: true, message: '请填写值' },
      { type: 'number', min: 0, max: 999, message: '值在0-999之间' },
    ],
  },
  {
    field: 'orderNo',
    label: '排序',
    component: 'InputNumber',
    rules: [
      { required: true, message: '请填写排序' },
      { type: 'number', min: 0, max: 999, message: '排序在0-999之间' },
    ],
  },
];
